package br.ufrj.dcc.ad;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ADSimProperties {
	
	private static Logger logger = LoggerFactory.getLogger(ADSimProperties.class);
	
	private static Properties properties;
	
	
	public static void loadProperties(String name) {
		final InputStream stream = ADSimProperties.class.getResourceAsStream(name);
		properties = new Properties();
		try {
			properties.load(stream);
		} catch (IOException e) {
			logger.error("Falha ao ler arquivo properties.", e);
		}
	}

	
	public static Long getMSS() {
		return Long.valueOf((String) properties.get("mss"));
	}
	
	public static Long getBuffer() {
		return Long.valueOf((String) properties.get("buffer"));
	}
	
	public static Long getCg() {
		return Long.valueOf((String) properties.get("cg"));
	}
	
	public static Long getCs() {
		return Long.valueOf((String) properties.get("cs"));
	}
	
	public static Double getTp1() {
		return Double.valueOf((String) properties.get("tp1"));
	}
	
	public static Double getTp2() {
		return Double.valueOf((String) properties.get("tp2"));
	}
	
	public static Long getN1() {
		return Long.valueOf((String) properties.get("n1"));
	}
	
	public static Long getN2() {
		return Long.valueOf((String) properties.get("n2"));
	}
	
	public static Double getTft() {
		return Double.valueOf((String) properties.get("tft"));
	}
	
	public static Double getTfi() {
		return Double.valueOf((String) properties.get("tfi"));
	}
	
	public static Double getSimulationTime() {
		return Double.valueOf((String) properties.get("time"));
	}
	
	public static String getQueue() {
		return (String) properties.get("queue");
	}

}
